Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MXCUBEApplication and Server static classes #1050

Merged
merged 3 commits into from
Sep 21, 2023

Conversation

marcus-oscarsson
Copy link
Member

@marcus-oscarsson marcus-oscarsson commented Sep 20, 2023

Discovered that MXCUBEApplication and Server got instanciated at some point causing an issue of
shadowing attributes.

  • MXCUBEApplication and Server are static classes and does not need to ( should not be) instanceanciated
  • Simplified the code removed the globlas mxcube and server (not needed)

@marcus-oscarsson marcus-oscarsson changed the title MXCUBEApplication and Server static clases MXCUBEApplication and Server static classes Sep 20, 2023
@fabcor-maxiv
Copy link
Contributor

Can we enforce this somehow? I do not recall how this is typically handled in Python. Maybe with an __init__ that raises NotImplemented?

@marcus-oscarsson
Copy link
Member Author

marcus-oscarsson commented Sep 20, 2023

Yes it can be done, its a good idea :)

@marcus-oscarsson
Copy link
Member Author

Like so :)

@fabcor-maxiv
Copy link
Contributor

fabcor-maxiv commented Sep 20, 2023

For consistency: in mxcube3/__init__.py, why not import ... as server and import ... as mxcube? Or the other way around (which might be better actually, not sure) use Server and MXCUBEApplication consistently everywhere?

@marcus-oscarsson
Copy link
Member Author

Yes, that makes sense :)

@marcus-oscarsson marcus-oscarsson merged commit bceeeed into develop Sep 21, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants